cmake_minimum_required(VERSION 3.5)

project(echo_server_v3.1)

if(CMAKE_COMPILER_IS_GNUCXX)
    add_compile_options(-std=c++11)
    message("using c++11 for compiling!")
endif()

add_compile_options(-g)
message("using -g for debug!")
add_compile_options(-w)
message("using -w for ignore warning!")

file(GLOB NETLIBS "netlib/src/*.cc")
file(GLOB THREADPOOLS "threadpool/src/*.cc")  # how to ignore test.cc

add_executable(
    ${PROJECT_NAME}
    ${NETLIBS}
    ${THREADPOOLS}
    MutexLock.cc
    server.cc
)

target_include_directories(
    ${PROJECT_NAME}
    PRIVATE 
        ${PROJECT_SOURCE_DIR}/netlib/include
        ${PROJECT_SOURCE_DIR}/threadpool/include
        ${PROJECT_SOURCE_DIR}/.
)

target_link_libraries(${PROJECT_NAME}
    PRIVATE
        pthread
)